home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10281 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  953 b 

  1. Path: inforamp.net!ts9-03
  2. From: rmorin@inforamp.net (Randy Charles Morin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: question assignment operator in c++
  5. Date: Thu, 07 Mar 96 06:05:00 GMT
  6. Organization: MiddleWorld SoftWare
  7. Message-ID: <4hlua6$6jg@sam.inforamp.net>
  8. References: <menghua_wang.1.002DB7BE@muccmail.missouri.edu>
  9. NNTP-Posting-Host: ts9-03.tor.inforamp.net
  10. X-Newsreader: News Xpress Version 1.0 Beta #4
  11.  
  12. In article <menghua_wang.1.002DB7BE@muccmail.missouri.edu>,
  13.    menghua_wang@muccmail.missouri.edu (menghua wang) wrote:
  14. >Why does not the following frind overloading work?
  15. >              mycalss operator= (myclass &A, myclass &B) {
  16. >                   A.i = B.i;
  17. >                   return A;
  18. >              }
  19.  
  20. Because, your example returns one myclass as the return value and one as a 
  21. referenced class.  This is redundant.  When the guys put C++ together they 
  22. decided that redundancy was not a feature they need for this function.
  23.  
  24. Agrivar
  25.